/**
 * Created by kevin on 2017/6/1.
 */
var modelMaker = require('../db').modelMaker;

function createModel(schema,name,options,schemaAction) {
    var Schema = modelMaker.Schema;
    var schemaObj = new Schema(schema,options);
    var obj = modelMaker.model(name,schemaObj);
    if (schemaAction) {
        schemaAction(schemaObj);
    }
    return obj;
}

var objId = modelMaker.Schema.Types.ObjectId;

module.exports={objId:objId,createModel:createModel};